/**
 * @Author : SL
 * @Date : 2019/5/30
 * @Version :1.0
 * @Last Modified by : SL
 * @Last Modified time : 2019/5/30
 **/
const {exec} = require('../db/mysql')

const loginCheck = (username, password) => {
    const sql = `select username,realname from users where username='${username}' and password='${password}'`
    return exec(sql).then(rows => {
        return rows[0] || {}
    })
    //先使用假数据
    // if (username === 'zhangsan' && password === '123') {
    //     return true
    // }
    // return false
}
module.exports = {
    loginCheck
}